-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[Sentry] Add tags and attributes for easier user grouping #81052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@alitoshmatov Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| if (!value) { | ||
| return; | ||
| } | ||
| sendReportsCountTag(Object.keys(value).length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ PERF-11 (docs)
This Onyx connection subscribes to the entire REPORT collection, causing the callback to re-execute whenever ANY report changes in ANY way (e.g., a message is added, status changes, metadata updates). Since the callback only needs the COUNT of reports, this creates unnecessary re-renders and performance overhead.
Suggested fix: Consider implementing a more optimized approach:
- Track report count separately in Onyx (e.g., as a separate key like
REPORT_COUNT) - Or use a selector that only returns the count/keys to minimize data processing
- Or debounce the tag update to avoid excessive Sentry API calls
Example with selector (though this still triggers on any report change):
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
selector: (reports) => Object.keys(reports ?? {}).length,
callback: (count) => {
if (!count) {
return;
}
sendReportsCountTag(count);
},
});However, the ideal solution would be tracking report count separately to avoid re-computation on every report change.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is right in fact that we connect to large dataset.
This altough is not used in any screen component so comment is wrong about rerenders overhead.
Onyx.connectWithoutView does not have selector prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b802b826fd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
cc: @adhorodyski @rlinoz this is ready for review |
Explanation of Change
This PR introduces new tags attached to Sentry's spans which are:
We do so to enhance further analysis and reporting about how our application behaves for different kinds of user. We segment users by account size
Fixed Issues
$ #80531
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari